

	<script type="text/javascript" src="js/jsapi.js"></script>

  <script type="text/javascript">

    google.load('visualization', '1', {packages: ['annotatedtimeline']});
    function drawVisualization() {
      var data = new google.visualization.DataTable();
      <?php
      echo  "data.addColumn('date', 'Date');";
      echo  "data.addColumn('number', '退款次数');\n";
      echo  "data.addColumn('number', '售出次数');\n";
      echo  "data.addColumn('number', '退款件数');\n";      
      echo  "data.addColumn('number', '售出件数');\n";
      echo  "data.addColumn('number', '退款额');\n";     
      echo  "data.addColumn('number', '营销额');\n";
	  echo "data.addRows([";
	  $result="";
	  while($row = mysql_fetch_array($lineCurve))
      {
   	     $time=$row['sale_date'];
   	      	
			$date=date('Y,n,j', strtotime($time." -1 month"));
			
			 $return_case=$row['return_case'];
			 $sell_case=$row['sell_case'];
			 $return_number=$row['return_number'];
			 $sell_number=$row['sell_number'];
			 $return_amount=$row['return_amount'];
			 $sell_amount=$row['sell_amount'];
   	      	$result.=" [new Date($date), $return_case, $sell_case,$return_number,$sell_number,$return_amount,$sell_amount],";
   	     
		  
     }
	  if($result!=""){
		 $result=substr($result,0,-1);
		}
	  echo $result."]);";
	  //echo "]);";
      ?>
      
    
      var annotatedtimeline = new google.visualization.AnnotatedTimeLine(
          document.getElementById('visualization'));
     annotatedtimeline.draw(data, {'displayAnnotations': true});
    }
    
    google.setOnLoadCallback(drawVisualization);
  </script>

    <div id="visualization" style="width: 1000px; height: 800px;"></div>
